<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>表单（二）多个表单项的动态校验</title>
    <script src="./js/yaoyao002.js"></script>
    <style>
        body,p{
            margin: 0px;
            padding: 0px;
        }
        form{
            margin: 80px;
        }
        div{
            margin: 20px;
        }
        label{
            display: inline-block;
            width: 20%;
            text-align: end;
            margin-right: 20px;
            font-weight:bold;
            font-size: 18px;
            vertical-align: top;
        }
        input[name]{
            width: 60%;
            height: 50px;
            border: 1px solid gray;
            border-radius: 10px;
        }
        input[value]{
            background:steelblue;
            color: white;
            width: 100px;
            height: 50px;
            border-radius: 5px;
            margin-left: 75%;
        }
        p{
            margin-left: 22%;
            margin-top: 5px;
            font-size: 12px;
            display: none;
        }
    </style>
</head>
<body>
        <form action="#" method="get" onsubmit="return checkInput()">
            <div class="inputDiv">
                <label>名称</label>
                <input type="text" name="fname" id="nameTf" onfocus="inputOnFocus(this)" onblur="inputOnblur(this)"/>
                <p id="inputTipName">内容不能为空</p>
            </div>
            <div class="inputDiv">
                <label>密码</label>
                <input type="password" name="fPassword" id="passwordTf" onfocus="inputOnFocus(this)" onblur="inputOnblur(this)"/>
                <p id="inputTipPwd">内容不能为空</p>
            </div>
            <div class="inputDiv">
                <label>密码确认</label>
                <input type="password" name="fRepassword" id="rePasswordTf" onfocus="inputOnFocus(this)" onblur="inputOnblur(this)"/>
                <p id="inputTipRepwd">内容不能为空</p>
            </div>
            <div class="inputDiv">
                <label>邮箱</label>
                <input type="text" name="fmail" id="mailTf" onfocus="inputOnFocus(this)" onblur="inputOnblur(this)"/>
                <p id="inputTipMail">内容不能为空</p>
            </div>
            <div class="inputDiv">
                <label>手机</label>
                <input type="text" name="fphone" id="phoneTf" onfocus="inputOnFocus(this)" onblur="inputOnblur(this)"/>
                <p id="inputTipPhone">内容不能为空</p>
            </div>
                <input type="submit" value="提交" />
            </form>
</body>
</html>